﻿using AssembleComputer.Com;
using System;
using Microsoft.Extensions.DependencyInjection;

namespace AssembleComputer
{
    class Program
    {
        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");
            //Computer computer = new Computer(new DellDisplay(), new AMDCPU());
            //computer.Display("Dell", "AMD");
            using (ServiceProvider container = Computer())
            {
                var controller = container.GetRequiredService<Computer>();

                Console.WriteLine(controller.Display());
            }
        }
        static ServiceProvider Computer()
        {
            var services = new ServiceCollection();
            services.AddSingleton<IMainCPU, AMDCPU>();
            services.AddSingleton<IDisplay, TCLDisplay>();
            services.AddTransient<Computer>();
            return services.BuildServiceProvider();
        }
        //public void Display()
        //{

        //}
    }
}
